home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / QuickTime / QuickTime VR / Make QTVR Panorama / CApp.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.8 KB  |  171 lines  |  [TEXT/CWIE]

  1. /*
  2.     Make QTVR Panorama 1.0b1
  3.     
  4.     A simple PowerPlant application for processing PICT files into QuickTime VR™ movies.
  5.     
  6.     Created 29 Jan 1996 by EGH
  7.     
  8.     Copyright © 1996, Apple Computer, Inc. All rights reserved.
  9. */
  10.  
  11. #pragma once
  12.  
  13. #ifndef __MOVIES__
  14. #include <Movies.h>
  15. #endif
  16.  
  17. #include <LDocApplication.h>
  18. #include <LListener.h>
  19.  
  20. #include "CPreferences.h"
  21.  
  22. #if PRAGMA_ALIGN_SUPPORTED
  23. #pragma options align=mac68k
  24. #endif
  25.  
  26. typedef struct P2VRPrefsRec
  27. {
  28.         // default movie making parameters
  29.     Int16 width;
  30.     Int16 height;
  31.     Fixed pan;
  32.     Fixed tilt;
  33.     Fixed zoom;
  34.     CodecType codec;
  35.     CodecQ spatialQuality;
  36.     Int16 depth;
  37.     
  38.     Str31 tileSuffix;
  39.     Str31 movieSuffix;
  40.     
  41.     Boolean replaceFiles;
  42.     
  43.         // drop mode or what
  44.     Boolean dropMode;
  45. } P2VRPrefsRec, *P2VRPrefsPtr, **P2VRPrefsHdl;
  46.  
  47. #if PRAGMA_ALIGN_SUPPORTED
  48. #pragma options align=reset
  49. #endif
  50.  
  51. class CApp :
  52.     public LDocApplication,
  53.     public LListener
  54. {
  55. public:
  56.  
  57.     CApp();
  58.     virtual ~CApp();
  59.     
  60.     virtual Boolean ObeyCommand(
  61.         CommandT inCommand, 
  62.         void *ioParam = nil);
  63.     virtual void FindCommandStatus(
  64.         CommandT inCommand,
  65.         Boolean &outEnabled, 
  66.         Boolean &outUsesMark,
  67.         Char16 &outMark, 
  68.         Str255 outName);
  69.     
  70.     virtual void DoAEOpenOrPrintDoc(
  71.         const AppleEvent &inAppleEvent,
  72.         AppleEvent &outAEReply,
  73.         Int32 inAENumber);
  74.     virtual void ChooseDocument();
  75.     virtual void OpenDocument(
  76.         FSSpec *inMacFSSpec);
  77.     
  78.     virtual void StartUp();
  79.     
  80.     void ProgressEvents();
  81.     
  82.     virtual void ListenToMessage(
  83.         MessageT inMessage,
  84.         void *ioParam);
  85.     
  86.     P2VRPrefsHdl GetPreferences()
  87.         { return mPrefsHdl; }
  88.     
  89.     void BugUserTilSwitchedIn();
  90.  
  91. private:
  92.  
  93.     static Boolean sCancelled;
  94.     static Boolean sBusy;
  95.     static LWindow *sProgressWindow;
  96.     static Boolean MovieProgressProc(
  97.         StringPtr inMessage);
  98.     
  99.     Boolean mDropMode;
  100.     
  101.     P2VRPrefsHdl mPrefsHdl;
  102. };
  103.  
  104. const ResIDT ALRT_NoQT = 130;
  105. const ResIDT ALRT_WeDontPrint = 131;
  106. const ResIDT ALRT_ConfirmSize = 132;
  107. const ResIDT ALRT_ConfirmOrientation = 133;
  108.  
  109. const OSType Creator_ = 'p2vr';
  110.  
  111. const OSType ResType_Preferences = 'prEF';
  112.  
  113. extern CApp *gApp;
  114.  
  115. const CommandT cmd_DropMode = 100;
  116. const CommandT cmd_Preferences = 101;
  117.  
  118. const ExceptionCode Exception_UserCancelled = 99;
  119. const ExceptionCode Exception_BadParameter = 100;
  120.  
  121. typedef Boolean (*ProgressProc)(
  122.     Str255 inProgressMessage);
  123.  
  124. const ResIDT WIND_Pict2VR = 456;
  125. const ResIDT WIND_Preferences = 457;
  126. const ResIDT WIND_Splash = 458;
  127.  
  128. enum
  129. {
  130.     str_Making = 1,
  131.     STRx_Progress = 223
  132. };
  133.  
  134. // ==============================================
  135. // stuff for telling the app to make a QTVR movie
  136.  
  137. typedef struct MovieMakinRec
  138. {
  139.     FSSpec srcSpec;
  140.     FSSpec tileSpec;
  141.     FSSpec destSpec;
  142.     Int16 width;
  143.     Int16 height;
  144.     Fixed pan;
  145.     Fixed tilt;
  146.     Fixed zoom;
  147.     CodecType codec;
  148.     CodecQ spatialQuality;
  149.     Int16 depth;
  150.     Boolean completed; // response
  151. } MovieMakinRec, *MovieMakinPtr;
  152.  
  153. const MessageT msg_MakeMovie = 'mkmv';
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.